<template>
  <div id="app">
    <!-- 内部 -->
    <div class="main">
      <div class="Page_wrap">
        <!-- 身体 -->
        <div class="f-container">
          <!-- 左上角图标自己写 -->
          <!-- <div>
              <a href="#">
                  <img src="" alt="">
              </a>
          </div> -->

          <div class="row">
            <div class="left">

              <!-- 轮播图 -->
              <div>
                <el-carousel style="border-radius: 10px 0px 0px 10px" height="708px">
                  <el-carousel-item v-for="item in iArr" :key="item">
                    <img :src="item" width="100%" height="100%">
                  </el-carousel-item>
                </el-carousel>

              </div>
            </div>

            <div class="right">
              <el-card style="height: 100%;border-radius: 0px 10px 10px 0px">
                <!-- /// -->
                  <div class="text-center" style="font-size: 30px ;margin-bottom: 100px;margin-top: 70px;font-family: 'Baskerville Old Face'">欢迎登录山河后台</div>

                      <el-form style="width: 400px;margin: 30px auto" label-width="60px">
                        <el-form-item label="用户名">
                          <el-input type="text" v-model="admin.mgName" placeholder="请输入用户名"></el-input>
                        </el-form-item>
                        <el-form-item label="密码">
                          <el-input type="password"v-model="admin.mgPwd" placeholder="请输入密码"></el-input>
                        </el-form-item>

                        <el-form-item>
                          <el-button style="position: relative;margin-left: 115px" type="primary" @click="login()">登录
                          </el-button>
                        </el-form-item>
                        <!-- ////// -->
                        <div class="faq-service" style="margin: 0;margin-left: 60px">
                          <div class="fap-tips">
                            登录遇到问题？
                          </div>
                          <div class="fap-links">
                            <a href="#" class="fap-left">联系客服</a>
                            <a href="#" class="fap-right">常见问题</a>
                          </div>
                        </div>
                      </el-form>

              </el-card>
            </div>
          </div>
        </div>
      </div>
    </div>
    <router-view/>
  </div>
</template>

<style lang="less" scoped>


#app {
  width: 100%;
  height: 100%;
  display: flex;

  justify-content: center;

  align-items: center;
}

.main {
  position: relative;
  height: 748px;
  margin-top: 50px;
}

.page_wrap {
  padding-top: 50px;
}

.page_wrap {
  display: flex;
  min-height: calc(100% - 92px);
  -ms-flex-pack: center;
  justify-content: center;
  -ms-flex-align: center;
  align-items: center;
  padding-top: 100px;
}

.f-container {
  width: 1000px;
  background-color: #fff;
  padding: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: 0;
  margin-left: 0;
}

/* 轮播图 */
.left {
  width: 500px;
  height: 708px;
  flex: 0 0 50%;
  max-width: 50%;
}

.left img {
  width: 100%;
  height: 708px;
}

.right {
  flex: 0 0 50%;
  max-width: 50%;
}

.login {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
  -webkit-flex-direction: column;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.right > * {
  min-height: 584px;
}

/* // */
.text-center {
  text-align: center !important;
}

.login .title {
  font-size: 30px;
  color: #3b3e40;
  font-weight: 500;
  margin: 0;
}

.account {
  margin-top: 0px;
}

.d-input {
  width: 100%;
  width: 300px;
  height: 68px;
}

.md-input {
  width: 100%;
  height: 48px;
  margin: 20px 0 0;
  display: flex;
  position: relative;
  border-radius: 2px;
  border: 1px solid #ddd;
}






/* ///////// */
.booton-links {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;

}

.login .txt-tin {
  color: #44a8f2;
  cursor: pointer;
  text-decoration: none;
}

/* ////////// */
.line {
  margin-top: 30px;
}

.line .bg-orange {
  padding: 5px 8px;
  display: inline-block;
  color: #707473;
  background-color: #fff;
  opacity: 1;
}

.login .line {
  text-align: center;
  line-height: 44px;
}

/* /// */

.btn-wechat {
  margin-top: 10px;
  color: #ccc;
  background: #47b247;
  border: none;
  color: #fff;
  height: 48px;
  width: 100%;
}

.btn-slot {
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon {
  width: 20px;
  height: 20px;
}

.login .btn-slot .name {
  margin-left: 10px;
}


.login-agree {
  text-align: center;
  font-size: 12px;
  color: #707473;
  width: 300px;
  margin: auto;
  margin-top: 10px;
}

/* //////// */
.faq-service {
  margin-top: 64px;
  width: 300px;
}

.fap-tips {
  color: rgba(0, 0, 0, .85);
  font-size: 14px;
  letter-spacing: -.28px;
  text-align: center;
  line-height: 20px;
  height: 20px;
}

.fap-links {
  font-size: 14px;
  letter-spacing: -.28px;
  text-align: center;
  line-height: 20px;
  height: 20px;
}

.fap-links a {
  color: #44a8f2;
  cursor: pointer;
  text-decoration: none;
}

.fap-left {
  padding-right: 8px;
  text-align: right;
  border-right: 1px solid rgba(0, 0, 0, .09);
}

.fap-right {
  padding-left: 8px;
  text-align: left;
}


</style>

<script>

export default {

  data() {
    return {
      iArr: [
        "https://account.djicdn.com/pc/static/img/banner5.9f30612.jpg",
        "https://account.djicdn.com/pc/static/img/banner3.56d7e41.jpg",
        "https://account.djicdn.com/pc/static/img/banner4.f355fb3.jpg",
        "https://account.djicdn.com/pc/static/img/banner6.d099390.jpg",
        "https://account.djicdn.com/pc/static/img/banner9.47bfef8.jpg",
        "https://account.djicdn.com/pc/static/img/banner12.1c917b5.jpg",
      ],
      admin: {
        mgName: '',
        mgPwd: ''
      }
    }
  },
  methods: {
    login() {
      let url = "http://localhost:8080/admin/login"
      this.axios.post(url,this.admin).then((response) => {
        if(response.data==1){
          location.href="http://localhost:8081/admin";//显示管理页面
        }else if (response.data==2){
          v.$message.error("用户不存在")
        }else{
          v.$message.error("密码错误")
        }
      })
    }
  }
}


</script>